package com.rentalcar.rental_car.service.impl;

import com.rentalcar.rental_car.dao.CarMapper;
import com.rentalcar.rental_car.entity.Car;
import com.rentalcar.rental_car.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarServiceImpl implements CarService {
    @Autowired
    private CarMapper carMapper;

    @Override
    public List<Car> selectByType(String type) {

        return carMapper.selectByType(type);
    }

    @Override
    public List<Car> selectByAddress(String address) {

        return carMapper.selectByAddress(address);
    }

    @Override
    public List<Car> selectByColor(String color) {

        return carMapper.selectByColor(color);
    }

    @Override
    public int add(Car car) {

        return carMapper.add(car);
    }

    @Override
    public int update(Car car) {

        return carMapper.update(car);
    }

    @Override
    public int delete(Car car) {

        return carMapper.delete(car);
    }


    @Override
    public List<Car> getCarAll() {

        return carMapper.getCarAll();
    }
}
